/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights
 * reserved. <a>http://www.cqcis.com</a>
 */
package com.cqcis.uip.base.logadaptor;

import java.util.List;

import org.apache.log4j.Appender;
import org.apache.log4j.FileAppender;

/**
 * @author huangmy
 * @date   2008-2-1
 */
public interface LoggerAppenderRepository {
	/**
	 * 当前线程从模板appender中获取一个appender
	 * 
	 * @param appender
	 * @return
	 */
	public Appender createOrGetAppenderFor(LogConfiguration logConfig, FileAppender tmplAppender);
	
	/**
     * 注册指定线程的日志目录名
     * @param filename
     */
    public void register(LogConfiguration logConfiguration, Thread thread);
        
    /**
     * 取消设置的目录
     */
    public void unregister(Thread thread);
	
    /**
     * 获取指定线程相关联的appender
     * @return
     */
    public List<Appender> getAppenders(Thread thread);   
    
    /**
     * 获取指定线程相关联的日志配置
     * @return
     */
    public List<LogConfiguration> getLogConfigurations(Thread thread);
    
    /**
     * 删除指定线程上的日志配置
     * 
     * @param logConfiguration
     * @param thread
     */
    public void removeLogConfiguration(LogConfiguration logConfiguration, Thread thread);
            
    /**
     * 试图删除并关闭指定日志配置的日志组件
     * 
     * @param logConfiguration
     */
    public void tryCloseLogAppender(LogConfiguration logConfiguration);
}
